<template>
  <div>
    <wang-editor ref="wangEditor" v-model:value="msg" />
    <div>{{ msg }}</div>
  </div>
</template>
<script>
import { ref, defineComponent, onMounted } from 'vue';
import WangEditor from '@/components/wang-editor';
export default defineComponent({
  name: '',
  setup() {
    const wangEditor = ref();
    const msg = ref('初始值');
    onMounted(() => {
      // 设置初始值或者恢复初始值
      wangEditor.value.setValue(msg.value);
    });

    return {
      wangEditor,
      msg,
    };
  },
  components: {
    WangEditor,
  },
});
</script>
<style lang="less"></style>
